package com.wjw;

/**
 * Singleton - 懒汉式线程安全
 *
 * @author ikaros
 * @date 2024/7/18 1:32
 * @see <a href="ikaros@qq.com">mailTo: ikaros@qq.com</a>
 */
public class Singleton04 {

    private static Singleton04 instance;

    private Singleton04(){
    }

    public static synchronized Singleton04 getInstance(){
        if (instance != null) {
            return instance;
        }
        return new Singleton04();
    }
}
